﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
namespace Test.Service
{
    public class Questdb
    {
        public SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig { 
        ConnectionString= "host=129.211.210.38;port=8812;username=admin;password=quest;database=qdb;ServerCompatibilityMode=NoTypeLoading;",
        DbType=DbType.QuestDB,
        IsAutoCloseConnection=true
        }, db => {
            db.Aop.OnLogExecuted = (sql, pars) =>
            {
              //  var sqlstr = UtilMethods.GetSqlString(DbType.QuestDB, sql, pars);
               // Console.WriteLine(sqlstr);
            };
        });

        public void DbInit()
        {
            Db.CodeFirst.InitTables<User>();

            Db.CodeFirst.InitTables<UserLogs>();
        }
    }


    public class User
    {
        public Guid Id { get; set; }
        public string? UserNo{get;set;}

        public string? UserName { get;set;}

    }

    public class UserLogs
    { 
        public Guid Id { get; set; }
    public Guid UserId { get; set; }
    public string? Val { get; set;}
    }

   
}
